package com.project.weather.utils;

import java.util.List;
import java.util.UUID;

public class StringUtil {
    public StringUtil() {
    }

    public static boolean isNull(Object obj) {
        if (obj == null) {
            return true;
        } else if (obj instanceof String && ("".equals(((String)obj).trim()) || "null".equals(((String)obj).trim()))) {
            return true;
        } else {
            return obj instanceof List && ((List)obj).size() <= 0;
        }
    }

    public static String getUUID() {
        String uuid = UUID.randomUUID().toString();
        return uuid.replace("-", "");
    }

    public static String upperFirst(String str) {
        char[] cs = str.toCharArray();
        cs[0] = (char)(cs[0] - 32);
        return String.valueOf(cs);
    }
}